<template>
  <div class="menu-footer container">
      <div class="menu-cart">
          <i class="el-icon-shopping-cart-1 cart-icon"></i>
          <span>￥{{ allPrice }}</span>
      </div>
      <div class="cart-btn" @click="handleJump">选好了</div>
  </div>
</template>

<script>
import junpPage from '@/mixin/common'
import {mapState} from 'vuex'
export default {
    name: 'MenuFooterBanner',
    mixins: [junpPage],
    computed: {
        ...mapState(['detailList']),
        allPrice() {
            console.log(this.detailList,'this.detailList123',this);
            return this.detailList.reduce((prev, current) => (prev + current.count * current.price), 0)
        }
    },
    methods: {
        handleJump() {
            this.$router.push('/shopping-cart')
        }
    }
}
</script>

<style scoped>
.menu-footer {
    display: flex;
    height: 7vh;
    color: #fff;
    font-size: 16px;
    align-items: center;
}
.menu-cart {
    width: 80%;
    height: 100%;
    line-height: 100%;
    padding-left: 20px;
    background-color: #FEC76C;
    display: flex;
    align-items: center;
}
.cart-icon {
    font-size: 35px;
}
.cart-btn {
    width: 20%;
    line-height: 7vh;
    background-color: #FF9D02;
    text-align: center;
}
</style>